import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Main',
    component: ()=> import('@/views/Main.vue'),

    //二级路由
    children:[
      {
        path:'home',
        //别名
        alias:'',
        name:'Home',
        component:()=>import('@/views/Home.vue')
      },
      {
        path:'menu',
        name:'Menu',
        component:()=>import('@/views/Menu.vue')
      },
      {
        path:'shopbag',
        name:'Shopbag',
        component:()=>import('@/views/Shopbag.vue')
      },
      {
        path:'my',
        name:'My',
        component:()=>import('@/views/My.vue')
      },
    ]
  },

  {
    path:'/detail',
    name:'Detail',
    component:()=>import('@/views/Detail.vue')
  },
  {//登录页面
    path:'/login',
    name:'Login',
    component:()=>import('@/views/Login.vue')
  },
  {
    path:'/register',
    name:'Register',
    component:()=>import('@/views/Register.vue')
  },
  {//我的
    path:'/mydata',
    name:'MyData',
    component:()=>import('@/views/MyData.vue')
  },
  {//结算
    path:'/confirmorder',
    name:'ConfirmOrder',
    component:()=>import('@/views/ConfirmOrder.vue')
  },
  {//新建或者编辑地址
    path:'/newaddress',
    name:'NewAddress',
    component:()=>import('@/views/NewAddress.vue')
  },
  {// 选择地址
    path:'/address',
    name:'Address',
    component:()=>import('@/views/Address.vue')
  },
  {// 我的订单
    path:'/order',
    name:'Order',
    component:()=>import('@/views/Order.vue')
  },
  {// 我的收藏
    path:'/shoucang',
    name:'ShouCang',
    component:()=>import('@/views/ShouCang.vue')
  },
  {// 安全中心
    path:'/safety',
    name:'Safety',
    component:()=>import('@/views/Safety.vue')
  },
  {// 忘记密码
    path:'/forgetpassword',
    name:'ForgetPassword',
    component:()=>import('@/views/ForgetPassword.vue')
  },
  {// 找回密码
    path:'/complatefind',
    name:'ComplateFind',
    component:()=>import('@/views/ComplateFind.vue')
  }

]

const router = new VueRouter({
  routes
})

export default router
